//
//  Primer_Closure_DemoVC.swift
//  APSwift
//
//  Created by jianbo.pei on 2022/8/19.
//

import UIKit

class Primer_Closure_DemoVC: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        /// 尾随闭包
        trailingClosureTest()
        
    }
    
}

//!!!: 闭包分类
extension Primer_Closure_DemoVC {
   
    //MARK: 尾随闭包
    private func trailingClosureTest() {
        let strs = ["1","2","3","4","5"]
        let nums: [Int] = strs.map { str in
            return Int(str) ?? 0
        }
        debugPrint("nums is \(nums)")
    }
    
}


